import request from '@/utils/request'
import API from '../api'


// 立即购买，生成订单
/*
 * @param skuId 商品id
 * @param count 购买数量
 * @param addressId 地址id
 */
export const getCreateOrder = (skuId: string, count: number, addressId: string) => request.get<any, any>(API.CREATEORDER + `?skuId=${skuId}&count=${count}&addressId=${addressId}`)


// 获取我的订单
/*
 * @param page 页码
 * @param pageSize 每页显示的条数
 * @param orderState 订单状态
 */
export const getMyOrder = (page: string, pageSize: string, orderState: number) => request.get<any, any>(API.MYORDER + `?page=${page}&pageSize=${pageSize}&orderState=${orderState}`)